package com.novice.controller;

import com.novice.domain.entity.Order;
import com.novice.service.IOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "订单服务")
@RestController
@RequestMapping("/api/order")
public class OrderController {
    @Resource
    private IOrderService orderService;

    @ApiOperation("根据id查询订单详情")
    @RequestMapping("/{orderId}")
    public Order getOrderById(@PathVariable("orderId") Long orderId) {
        return orderService.getOrderById(orderId);
    }
}
